<template>
  <div>
    <el-card>
      <el-row type="flex" justify="end">
        <el-button size="small" type="primary">添加权限</el-button>
      </el-row>
      <el-divider />
      <el-table border :data="permList">
        <el-table-column label="权限名称" prop="title" />
        <el-table-column label="权限标识" prop="code" />
        <el-table-column label="权限描述" prop="description" />
        <el-table-column label="操作">
          <template v-slot="{row}">
            <el-button size="small" type="primary">添加子权限</el-button>
            <el-button>编辑</el-button>
            <el-button size="small" type="danger">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { getPermissions } from '@/api/permissions'
export default {
  data() {
    return {
      permList: []
    }
  },
  created() {
    this.getPermissions()
  },
  methods: {
    async getPermissions() {
      this.permList = await getPermissions()
      console.log(this.permList)
    }
  }
}
</script>

<style>

</style>
